import type { CommonResult } from '@/models/request'
import type { ResourceCategory, ResourceCategoryParams } from '@/models/resourceCategory'
import request from '@/utils/request'

export function listAllCate() {
  return request<CommonResult<ResourceCategory[]>>({
    url: '/resourceCategory/listAll',
    method: 'get',
  })
}

export function createResourceCategory(data: ResourceCategoryParams) {
  return request<CommonResult>({
    url: '/resourceCategory/create',
    method: 'post',
    data: data,
  })
}

export function updateResourceCategory(id: number, data: ResourceCategoryParams) {
  return request<CommonResult>({
    url: '/resourceCategory/update/' + id,
    method: 'post',
    data: data,
  })
}

export function deleteResourceCategory(id: number) {
  return request<CommonResult>({
    url: '/resourceCategory/delete/' + id,
    method: 'post',
  })
}
